﻿using Ewelve_Four_HD.DAL;
using Ewelve_Four_HD.Model;

namespace Ewelve_Four_HD.BLL
{
    public class TypeBll
    {
        private readonly TypeDal typeDal;

        public TypeBll(TypeDal _typeDal)
        {
            typeDal = _typeDal;
        }
        /// <summary>
        /// 房态添加
        /// </summary>
        /// <param name="S"></param>
        /// <returns></returns>
        public int TypeAdd(RoomType S)
        {
            try
            {
                return typeDal.TypeAdd(S);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 房态查询分页
        /// </summary>
        /// <param name="TypeName"></param>
        /// <param name="RoomStage"></param>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <param name="PageSum"></param>
        /// <param name="PageCount"></param>
        /// <returns></returns>
        public IQueryable TypeShowAll(string? TypeName, int? RoomStage, int PageIndex, int PageSize, out int PageSum, out int PageCount)
        {
            return typeDal.TypeShowAll(TypeName, RoomStage, PageIndex, PageSize, out PageSum, out PageCount);
        }
    }
}